import request from '@/utils/request'

// 查询工资表列表
export function listStaffPayroll(query) {
  return request({
    url: '/compensationManagement/staffPayroll/list',
    method: 'get',
    params: query
  })
}

// 查询自身补贴工资列表
export function listSelfStaffPayroll(query) {
  return request({
    url: '/compensationManagement/viewSelfStaffpayroll/list',
    method: 'get',
    params: query
  })
}

// 查询工资表详细
export function getStaffPayroll(staffpayrollId) {
  return request({
    url: '/compensationManagement/staffPayroll/' + staffpayrollId,
    method: 'get'
  })
}

// 查询自身工资表详细
export function getSelfStaffPayroll(staffpayrollId) {
  return request({
    url: '/compensationManagement/viewSelfStaffpayroll/' + staffpayrollId,
    method: 'get'
  })
}

// 新增工资表
export function addStaffPayroll(data) {
  return request({
    url: '/compensationManagement/staffPayroll',
    method: 'post',
    data: data
  })
}

// 修改工资表
export function updateStaffPayroll(data) {
  return request({
    url: '/compensationManagement/staffPayroll',
    method: 'put',
    data: data
  })
}

// 删除工资表
export function delStaffPayroll(staffpayrollId) {
  return request({
    url: '/compensationManagement/staffPayroll/' + staffpayrollId,
    method: 'delete'
  })
}

// 查询工资表详细
export function getPayrollInformationByJobNumber(data) {
  return request({
    url: '/compensationManagement/staffPayroll/getPayrollInformationByJobNumber',
    method: 'post',
    data: data
  })
}

// 确定工资表
export function determiningStaffPayroll(data) {
  return request({
    url: '/compensationManagement/staffPayroll/determiningStaffPayroll',
    method: 'put',
    data: data
  })
}

// 查询浮动项
export function getFloatingItems() {
  return request({
    url: '/compensationManagement/staffPayroll/floatSelectItem' ,
    method: 'get'
  })
}
